<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // switch (key) {
      //   case value:

      //     break;

      //   default:
      //     break;
      // }
      /*
      状态码:
      1 未付款
      2 已付款
      3 已发货
      4 已完成
      */
      var code = 3
      switch (code) {
        case 1:
          document.write('未付款')
          break
        case 2:
          document.write('已付款')
          break
        case 3:
          document.write('已发货')
          break
        case 4:
          document.write('已完成')
          break
        default:
          document.write('出错了')
          break
      }
    </script>
  </body>
</html>
